package com.opal.model;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.ArrayList;
import java.util.List;

/**
 * easyui的tree属性
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class EasyUiTree {
    private String id;                  //：节点ID，对加载远程数据很重要。
    private String text;                //显示节点文本。
    private String state="closed";               //：节点状态，'open' 或 'closed'，默认：'open'。如果为'closed'的时候，将不自动展开该节点。
    private String checked;             //：表示该节点是否被选中。
    private String attributes;          //: 被添加到节点的自定义属性。
    private List<EasyUiTree> children =new ArrayList<>();  //: 一个节点数组声明了若干节点。

    public  EasyUiTree(){}

    public EasyUiTree(String id, String text) {
        this.id = id;
        this.text = text;
    }

    public EasyUiTree(String id, String text, String state) {
        this.id = id;
        this.text = text;
        this.state = state;
    }

    public EasyUiTree(String id, String text, String state, String checked, String attributes) {
        this.id = id;
        this.text = text;
        this.state = state;
        this.checked = checked;
        this.attributes = attributes;
    }

    public EasyUiTree(String id, String text, String state, String checked, String attributes, List<EasyUiTree> children) {
        this.id = id;
        this.text = text;
        this.state = state;
        this.checked = checked;
        this.attributes = attributes;
        this.children = children;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getChecked() {
        return checked;
    }

    public void setChecked(String checked) {
        this.checked = checked;
    }

    public String getAttributes() {
        return attributes;
    }

    public void setAttributes(String attributes) {
        this.attributes = attributes;
    }

    public List<EasyUiTree> getChildren() {
        return children;
    }

    public void setChildren(List<EasyUiTree> children) {
        this.children = children;
    }
}
